<template>
  <view class="content">
    <view class="components-title">
      <view class="components-title-t">gg-picker-date</view>
      <view class="components-title-d">日期选择</view>
    </view>
    <gg-nav-group>
      <gg-picker-date label="日期选择" v-model="formData.date" />
    </gg-nav-group>
    <gg-nav-group label="有默认时间">
      <gg-picker-date label="日期选择" v-model="formData.date2" />
    </gg-nav-group>
    <gg-nav-group label="限制开始时间">
      <gg-picker-date label="日期选择" v-model="formData.date" startDate="2020-09-02" />
    </gg-nav-group>
    <gg-nav-group label="限制结束时间">
      <gg-picker-date label="日期选择" v-model="formData.date" endDate="2020-09-02" />
    </gg-nav-group>
  </view>
</template>

<script>
export default {
  data() {
    return {
      formData: {
        date: '',
        date2: '',
      },
    };
  },
  onLoad() {
    setTimeout(() => {
      this.testReqMocck().then((res) => {
        this.formData.date2 = '2020-02-28'
      });
      console.log('模拟请求数据', this.formData);
    }, 1000)
  },
  methods: {
    testReqMocck(testData) {
      return new Promise((resolve, reject) => {
        resolve({
        });
      });
    }
  }
}
</script>

<style>
page {
  background: #f1f1f1;
}
</style>
